extends ../../components/layout
append style
  +css('demo/demo.css')
block title
  title button
block content
  header.demos-header
    h1.demos-title Dialog
  .demos-content
    .btn.test1 alert
    .btn.test2 confirm
    .btn.test3 prompt
    .btn.test4 modal
append script
  script.
    require(['dialog'], function () {
      $(".test1").on("click", function () {
        $.alert('内容', '标题', function () {
          console.log('回调')
        })
      })
      $(".test2").on("click", function () {
        $.confirm('内容', '标题', function () {
          console.log('确定')
        },function(){
          console.log('取消')
        })
      })
      $(".test3").on("click", function () {
        $.prompt({
          title: '标题',
          text: '内容',
          onOK: function (text) {
            $.alert("输入内容是" + text);
          },
          onCancel: function () {
            console.log("取消了");
          },
          input: 'test',
          empty: true
        });
      })
      $(".test4").on("click", function () {
        $.modal({
          title: "Hello",
          text: "我是自定义的modal",
          buttons: [
            {text: "支付宝", className: "primary", onClick: function () {$.alert("你选择了支付宝");}},
            {text: "微信支付", className: "primary", onClick: function () {$.alert("你选择了微信支付");}},
            {text: "取消", className: "default"}
          ]
        });
      })
    })